home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15502 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.primenet.com!jstern
  2. From: jstern@primenet.com (Josh Stern)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Functions in functions using function objects
  5. Date: 5 Apr 1996 15:25:01 -0700
  6. Organization: Primenet Services for the Internet
  7. Sender: root@primenet.com
  8. Message-ID: <4k46jt$q5@nnrp1.news.primenet.com>
  9. References: <4k1nus$8h1@barad-dur.nas.com>
  10. X-Posted-By: jstern@usr2.primenet.com
  11.  
  12. Matt Scott <gldnspud@kali.nas.com> wrote:
  13. >I was experimenting with various C++ constructs lately, and I thought
  14. >of an idea that might help me implement a Pascal construct that I
  15. >really enjoy but that isn't present in C or C++.
  16. >
  17. >I always liked the fact that Pascal was a block-structured language,
  18. >and that you could have functions (and procedures, for all you Pascal
  19. >types out there) inside other functions, which would be local to only
  20. >those functions that they were defined in.
  21. >
  22. >Since C and C++ are not block-structured, this is impossible. I did
  23. >find a way around it, though:
  24.  
  25. You might want to take a look at namespaces in C++.
  26. Offhand, I can't think of any reason for defining
  27. a function within a function that couldn't be handled
  28. using namespaces.
  29.  
  30.  
  31. - Josh
  32.  
  33.  
  34. --
  35. -------------------------------------------------------------------------------
  36. jstern
  37. jstern@primenet.com
  38. -------------------------------------------------------------------------------
  39.